<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
	<title>酒店信息添加--layui后台管理模板</title>
	<meta name="renderer" content="webkit"/>
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
	<meta name="apple-mobile-web-app-status-bar-style" content="black"/>
	<meta name="apple-mobile-web-app-capable" content="yes"/>
	<meta name="format-detection" content="telephone=no"/>
	<link rel="stylesheet" href="/layui/css/layui.css" media="all" />
	<link rel="stylesheet" href="/css/font_eolqem241z66flxr.css" media="all"/>
</head>
<body class="childrenBody">
	<form class="layui-form" id="addForm" >
		<div class="layui-form-item">
			<label class="layui-form-label">用户名</label>
			<div class="layui-input-block">
				<input id="userName" name="userName" type="text" class="layui-input newsName" lay-verify="required" placeholder="请输入用户名"/>
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">密码</label>
			<div class="layui-input-block">
				<input id="password" name="password" type="password" class="layui-input newsName" lay-verify="required" placeholder="请输入密码"/>
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">手机号码</label>
			<div class="layui-input-block">
				<input  id="linkTel" name="linkTel" type="text" class="layui-input newsName" lay-verify="required" placeholder="请输入手机号码"/>
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">真实姓名</label>
			<div class="layui-input-block">
				<input id="name" name="name" type="text" class="layui-input newsName" lay-verify="required" placeholder="请输入真实姓名"/>
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">状态</label>
			<div class="layui-input-inline">
				<select id="state" name="state" class="newsLook" lay-filter="browseLook">
					<option  value="0">停用</option>
					<option  value="1">启用</option>
				</select>
			</div>
		</div>
		<div class="layui-form-item">
			<div class="layui-input-block">
				<button class="layui-btn" type="button" onclick="admin_add();" lay-submit="">保存</button>
				<a class="layui-btn" href="/admin_list">返回</a>
				<button type="reset" class="layui-btn layui-btn-primary">重置</button>

			</div>
		</div>
	</form>
	<script type="text/javascript" src="/layui/layui.js"></script>
	<script type="text/javascript" src="/js/admin/adminEdit.js"></script>
	<script type="text/javascript" src="/js/jquery-1.7.2.js"></script>
	<script type="text/javascript">

		//新增旅游路线
		function admin_add() {
			//表单序列化作用，获取表单中的数据
			var datas = $("#addForm").serialize();
			//alert(datas);
			$.post("/admin_add", datas, function (result) {
				if (result.code == 200) {
					layer.msg('新增成功', {
						time: 2000, //2s后自动关闭
					}, function () {
						location.href = "/admin_list";
					});
				} else {
					layer.msg('新增异常', {
						time: 2000, //2s后自动关闭
					});
				}
			});
		}
	</script>
</body>
</html>